package think.thread.sychron.c02.pipe;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class PipeIO {
	public static void main(String[] args) throws Exception{
		Sender sender=new Sender();
		Receive receive=new Receive(sender);
		
		ExecutorService exec=Executors.newCachedThreadPool();
		
		exec.execute(sender);
		exec.execute(receive);
		
		TimeUnit.SECONDS.sleep(3);
		
		exec.shutdownNow();
	}
}
